import platform = require('../../../../../platform/common/baseCommon');
import platformControls = require('../../../../../platform/client/controls');
import report = require('../../../../../platform/client/report');



//新建fieldControl
let controlOne = new platformControls.radioEditControl();
controlOne.radios = [];
controlOne.radios.push({ 'name': '男', 'value': '男' });
controlOne.radios.push({ 'name': '女', 'value': '女' });
controlOne.radios.push({ 'name': '人妖', 'value': '人妖' });
controlOne.radios.push({ 'name': '不明', 'value': '不明' });

controlOne.caption = '性别';

let dxkFieldEdit = new report.fieldEditInfo();
dxkFieldEdit.name = "dxk"
let dxkControl = new platformControls.selectEditControl();
dxkControl.caption = "多选框";
dxkFieldEdit.defaultData = [{ name: "示例1", caption: "Demo1", id: 1 }, { name: "示例2", caption: "Demo2", id: 2 }, { name: "示例3", caption: "Demo3", id: 3 }];
dxkControl.showField = "name";
dxkControl.valueField = "id";
dxkFieldEdit.editControl = dxkControl;

//新建一个edit
let radioEdit = new report.fieldEditInfo();
radioEdit.editControl = controlOne;


/**
 * 时间测试
 */
let timeContoone = new platformControls.timeEditControl();
timeContoone.caption = '时间控件';
timeContoone.timeMinView = 2;
//新建一个edit
let timeEditOne = new report.fieldEditInfo();
timeEditOne.editControl = timeContoone;


/** 数据显示器:参数输入 */
let paramReport = new report.parameterControl();
paramReport.name = 'testing';
paramReport.caption = '查询条件';
paramReport.dataSourceNames = ['123456'];
paramReport.dataViews = {};
paramReport.queryCount = 100;
paramReport.fields = [radioEdit, timeEditOne, dxkFieldEdit];


/**
 * 组件测试页面
 */
export let defaultObject = new report.smartReport();
defaultObject.caption = '组件测试页面';
defaultObject.dataSources = { '123456': new platform.dataQuerySource() };
defaultObject.layoutPanel = new platformControls.layoutPanel('project/test/config/client/smartReportApp/layout/layout.html');
defaultObject.modules = {};
defaultObject.modules[paramReport.name] = paramReport;
defaultObject.autoQuery = false;
